home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: news.sprintlink.net!eskimo!news
- From: mag@eskimo.com (mAg)
- Subject: Re: Bit Masking
- X-Nntp-Posting-Host: tia1.eskimo.com
- Message-ID: <DL257u.Dnq@eskimo.com>
- Sender: news@eskimo.com (News User Id)
- Organization: *.*
- X-Newsreader: WinVN 0.93.10
- References: <DKz5y4.8En@twisto.eng.hou.compaq.com>
- Date: Fri, 12 Jan 1996 07:38:18 GMT
-
- In article <DKz5y4.8En@twisto.eng.hou.compaq.com> (Wed, 10 Jan 1996 17:06:24 GMT),
- garyc%cs%contractors@bangate.compaq.com says :
- >
- >Can someone tell me the elegent way to clear specific bits from a
- >byte, e.g.
- >
- ># define BIT_1 1
- ># define BIT_2 2
- ># define BIT_3 4
- ># define BIT_4 8
- >
- >Set the bit: x |= BIT_x
- >
- >Clear the bit using BIT_x: ????
-
- x &= ~BIT_x
-
- --
- /* --------------------------------------------------------
- MAG@ESKIMO.COM
- http://www.eskimo.com/~mag/index.html
- ***********************************************************
- To understand recursion one must first understand recursion
- ***********************************************************
- -------------------------------------------------------- */
-
-